package lab5Source;

import lab5Source.S_Message.msgtypes;

public class S_MakeLadyBiggerCommand extends AbstractCommand {
	protected LadyBird lady;
	protected static final double factor = 1.2;
	
	public S_MakeLadyBiggerCommand(LadyBird lady) {
		super();
		this.lady = lady;
	}

	@Override
	public void Execute() {
		int size = (int) Math.round(lady.getSize() * factor);		
		this.setThemAllNewSize(size);
	}

	@Override
	public void Unexecute() {
		int size = (int) Math.round(lady.getSize() * 1/factor);
		this.setThemAllNewSize(size);
	}
	
	protected void setThemAllNewSize(int size) {
		lady.setSize(size);
		lady.setChanged();
		lady.notifyObservers(new S_Message(msgtypes.UPDATE_SIZE));
	}

}
